package com.kb.design.mapper.postgreSQL;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.kb.design.dto.DesignOrderDTO;
import com.kb.design.entity.DesignOrder;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

@Mapper
public interface DesignOrderMapper extends BaseMapper<DesignOrder> {
    //分页查询

    Page<DesignOrderDTO> queryByPage(Page<DesignOrderDTO> page, DesignOrderDTO designOrder);

    @Select("select * from design_order where id = #{id}")
    DesignOrder queryById(Long designOrder);

    @Update("UPDATE design_order SET status = #{status} WHERE order_no = #{orderNo}")
    int updateDesignOrder(@Param("orderNo") String orderNo, @Param("status") Integer status);

    @Update("UPDATE design_order SET del_flag = 1 WHERE order_no = #{orderNo}")
    int delByOrderNo(@Param("orderNo") String orderNo);
}